<?php
namespace app\examScore\controller;
use app\common\Base;
use think\Db;
//--年级有为班
class GradePromisingClass extends Base {
	
	public function index() {
		return $this->fetch();
	}

	public function pageQuery() {
			$result = Db::table("实验班级 a")
					  ->join("年级名称 c","a.年级号=c.ID","LEFT")
					  ->field("a.ID,年级号,年级名称,实验班级,火箭班,国际班")
					  ->order("年级号 desc")
					  ->select();
			return selectResult($result);
	}

	public function addUpdate() {
		$all = request()->param();
		try {
			update('实验班级', $all);
			return "000";
		} catch (Exception $e) {
			echo $e->getMessage();
		}
		return "999";
	}

	public function del() {
		$delIds = input("delIds");
		try {
			Db::name('实验班级')->where('ID','in',explode(",", $delIds))->delete();
			return "000";
		} catch (Exception $e) {
			echo $e->getMessage();
		}
		return "999";
	}
}
